﻿using System;
using System.ComponentModel.DataAnnotations;

namespace ORM.EF.Models
{
    /// <summary>
    /// 项目
    /// </summary>
    public class Project
    {
        /// <summary>
        /// 项目号
        /// </summary>
        [Key]
        public string PNo { get; set; }

        /// <summary>
        /// 项目名
        /// </summary>
        public string PName { get; set; }

        /// <summary>
        /// 项目预算
        /// </summary>
        public float PBudget { get; set; }

        /// <summary>
        /// 项目开工日期
        /// </summary>
        public DateTime PStartTime { get; set; }
        public Project() { }
    }

    /// <summary>
    /// 供应商
    /// </summary>
    public class Supplier
    {
        /// <summary>
        /// 供应商号
        /// </summary>
        [Key]
        public string SNo { get; set; }

        /// <summary>
        /// 供应商姓名
        /// </summary>
        public string SName { get; set; }

        /// <summary>
        /// 供应商地址
        /// </summary>
        public string Address { get; set; }

        /// <summary>
        /// 供应商电话
        /// </summary>
        public string Tele { get; set; }

        /// <summary>
        /// 供应商账号
        /// </summary>
        public string Account { get; set; }
        public Supplier() { }
    }

    /// <summary>
    /// 零件
    /// </summary>
    public class Part
    {
        /// <summary>
        /// 零件号
        /// </summary>
        [Key]
        public string PNo { get; set; }

        /// <summary>
        /// 零件规格
        /// </summary>
        public string PSpecification { get; set; }

        /// <summary>
        /// 零件名称
        /// </summary>
        public string PName { get; set; }

        /// <summary>
        /// 零件单价
        /// </summary>
        public float Price { get; set; }

        /// <summary>
        /// 零件描述
        /// </summary>
        public string Description { get; set; }
    }

    /// <summary>
    /// 供应关系
    /// </summary>
    public class SupplyRecord
    {
        /// <summary>
        /// 工程号
        /// </summary>
        [Key]
        public string ProjNo { get; set; }

        /// <summary>
        /// 供应商号
        /// </summary>
        [Key]
        public string SNo { get; set; }

        /// <summary>
        /// 零件号
        /// </summary>
        [Key]
        public string PartNo { get; set; }

        /// <summary>
        /// 供应量
        /// </summary>
        public int Count { get; set; }
    }

    /// <summary>
    /// 仓库
    /// </summary>
    public class Warehouse
    {
        /// <summary>
        /// 仓库号
        /// </summary>
        [Key]
        public string WNo { get; set; }

        /// <summary>
        /// 仓库面积
        /// </summary>
        public float Area { get; set; }

        /// <summary>
        /// 仓库电话
        /// </summary>
        public string Tele { get; set; }
    }

    /// <summary>
    /// 库存记录
    /// </summary>
    public class WarehouseRecord
    {
        /// <summary>
        /// 仓库号
        /// </summary>
        [Key]
        public string WNo { get; set; }

        /// <summary>
        /// 零件号
        /// </summary>
        [Key]
        public string PNo { get; set; }

        /// <summary>
        /// 库存量
        /// </summary>
        public int Count { get; set; }
    }

    /// <summary>
    /// 职工信息
    /// </summary>
    public class Worker
    {
        /// <summary>
        /// 职工号
        /// </summary>
        [Key]
        public string WNo { get; set; }

        /// <summary>
        /// 职工姓名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 职工性别
        /// </summary>
        public int Age { get; set; }

        /// <summary>
        /// 职工职称编号
        /// 外键
        /// </summary>
        public string TNo { get; set; }

        /// <summary>
        /// 职工工作仓库号
        /// 外键
        /// </summary>
        public string WareNo { get; set; }

        /// <summary>
        /// 职工领导号
        /// 外键
        /// </summary>
        public string LeaderNo { get; set; }
    }

    /// <summary>
    /// 职称
    /// </summary>
    public class Title
    {
        /// <summary>
        /// 职称号
        /// </summary>
        public string TNo { get; set; }

        /// <summary>
        /// 职称角色
        /// </summary>
        public string Role { get; set; }
    }
}